import request from '@/utils/request'

// 分页列表,按照组合名称模糊查询
export function findStrategyCompositionByPage(data) {
  return request({
    url: '/invest/strategy/findStrategyCompositionByPage',
    method: 'post',
    data
  })
}

// 添加或修改组合
export function addOrUpdateStrategyComposition(data) {
  return request({
    url: '/invest/strategy/addOrUpdateStrategyComposition',
    method: 'post',
    data
  })
}

// 根据id删除组合
export function deleteStrategyCompositionById(data) {
  return request({
    url: '/invest/strategy/deleteStrategyCompositionById',
    method: 'post',
    data
  })
}

////////////////////   详情

// 头部信息
export function getHeadDetail(data) {
  return request({
    url: '/invest/strategy/getCompositionByCompositionId',
    method: 'post',
    data
  })
}

// 收益走势图
export function findNetworthById(data) {
  return request({
    url: '/invest/networth/getCompositionNetworthByCompositionId',
    method: 'post',
    data
  })
}

// 收益走势图 新 分类叠加
export function findCompositionNetworthByCompositionIdNew(data) {
  return request({
    url: '/invest/networth/findCompositionNetworthByCompositionIdNew',
    method: 'post',
    data
  })
}


// 收益走势图 新 分类叠加（组合）
export function getStrategyAndCompositionByCompositionId(data) {
  return request({
    url: '/invest/networth/getStrategyAndCompositionByCompositionId',
    method: 'post',
    data
  })
}

// 最大回撤接口
export function getMaxDown(data) {
  return request({
    url: '/invest/networth/getCompositionMaxDown',
    method: 'post',
    data
  })
}

// 收益风险指标
export function getRiskRateById(data) {
  return request({
    url: '/invest/networth/getCompositionRiskRateByCompositionId',
    method: 'post',
    data
  })
}

// 历史净值列表
export function HistoryNetworthList(data) {
  return request({
    url: '/invest/networth/getCompositionHistory',
    method: 'post',
    data
  })
}

// 历史月度表现
export function findNetWorthMonthly(data) {
  return request({
    url: '/invest/networth/findCompositionNetWorthMonthly',
    method: 'post',
    data
  })
}

// 收益分布-列表
export function findNetWorthExtendBySegment(data) {
  return request({
    url: '/invest/networth/findCompositionNetWorthExtendBySegment',
    method: 'post',
    data
  })
}

// 收益分布-图
export function findNetWorthMonthlyHistogram(data) {
  return request({
    url: '/invest/networth/findCompositionNetWorthMonthlyHistogram',
    method: 'post',
    data
  })
}

// 月度回报-列表
export function findNetWorthMonthDetailByPage(data) {
  return request({
    url: '/invest/networth/findCompositionNetWorthMonthDetailByPage',
    method: 'post',
    data
  })
}

// 月度回报-图
export function findWorthMonthDistribute(data) {
  return request({
    url: '/invest/networth/findCompositionNetWorthMonthDistribute',
    method: 'post',
    data
  })
} 

// 分类列表
export function findClassifyByCompositionId(data) {
  return request({
    url: '/invest/strategy/findClassifyByCompositionId',
    method: 'post',
    data
  })
}

// 策略列表
export function findStrategyByCompositionId(data) {
  return request({
    url: '/invest/strategy/findStrategyByCompositionId',
    method: 'post',
    data
  })
}

/////////////////  配置组合

// 详情
export function getCompositionAndClassifysByCompositionId(data) {
  return request({
    url: '/invest/strategy/getCompositionAndClassifysByCompositionId',
    method: 'post',
    data
  })
}

// 保存
export function configComposition(data) {
  return request({
    url: '/invest/strategy/configComposition',
    method: 'post',
    data
  })
}

// 月度表现弹窗子数据
export function monthlyIncreaseDialog(data) {
  return request({
    url: '/invest/networth/monthlyIncreaseDialog',
    method: 'post',
    data
  })
}

// 月度表现弹窗子数据 -- 策略
export function strategyMonthlyIncreaseDialog(data) {
  return request({
    url: '/invest/networth/strategyMonthlyIncreaseDialog',
    method: 'post',
    data
  })
}

// 组合穿透策略-最大回撤曲线
export function getCompositionMaxDownPlus(data) {
  return request({
    url: '/invest/networth/getCompositionMaxDownPlus',
    method: 'post',
    data
  })
}

// 组合穿透策略-净值曲线
export function getStrategyAndCompositionByCompositionIdPlus(data) {
  return request({
    url: '/invest/networth/getStrategyAndCompositionByCompositionIdPlus',
    method: 'post',
    data
  })
}

// 同区间组合
export function findClassifyIntersection(data) {
  return request({
    url: '/invest/networth/findClassifyIntersection',
    method: 'post',
    data
  })
}


// ----------------- v0.2.0 优化 -----------------

// 组合分类树
export function findCompositionClassifyStrategyByCompositionId(data) {
  return request({
    url: '/invest/strategy/findCompositionClassifyStrategyByCompositionId',
    method: 'post',
    data
  })
}
// 季度收益-组合到分类
export function getCompositionNetWorthIncomByQuarter(data) {
  return request({
    url: '/invest/networth/getCompositionNetWorthIncomByQuarter',
    method: 'post',
    data
  })
}
// 年度收益-组合到分类
export function getCompositionNetWorthIncomByYear(data) {
  return request({
    url: '/invest/networth/getCompositionNetWorthIncomByYear',
    method: 'post',
    data
  })
}
// 区间收益-组合到分类
export function getCompositionAndClassifySegment(data) {
  return request({
    url: '/invest/networth/getCompositionAndClassifySegment',
    method: 'post',
    data
  })
}
// 季度收益-柱状图-组合到分类
export function getQuarterCompositionNetWorthDistribute(data) {
  return request({
    url: '/invest/networth/getQuarterCompositionNetWorthDistribute',
    method: 'post',
    data
  })
}
// 年度收益-柱状图-组合到分类
export function getYearCompositionNetWorthDistribute(data) {
  return request({
    url: '/invest/networth/getYearCompositionNetWorthDistribute',
    method: 'post',
    data
  })
}
// 区间收益-柱状图-组合到分类
export function getSegmentCompositionNetWorthDistribute(data) {
  return request({
    url: '/invest/networth/getSegmentCompositionNetWorthDistribute',
    method: 'post',
    data
  })
}

// 季度收益-组合到策略
export function getCompositionAndStrategyNetWorthByQuarter(data) {
  return request({
    url: '/invest/networth/getCompositionAndStrategyNetWorthByQuarter',
    method: 'post',
    data
  })
}
// 年度收益-组合到策略
export function getCompositionAndStrategyNetWorthByYear(data) {
  return request({
    url: '/invest/networth/getCompositionAndStrategyNetWorthByYear',
    method: 'post',
    data
  })
}
// 区间收益-组合到策略
export function getCompositionAndStrategySegment(data) {
  return request({
    url: '/invest/networth/getCompositionAndStrategySegment',
    method: 'post',
    data
  })
}

// 复制组合
export function copyStrategyComposition(data) {
  return request({
    url: '/invest/strategy/copyStrategyComposition',
    method: 'post',
    data
  })
}


// ----------------- v0.3.0 优化 -----------------

// 组合下投策相关性
export function getCompositionStrategyRelevance(data) {
  return request({
    url: '/invest/networth/getCompositionStrategyRelevance',
    method: 'post',
    data
  })
}

// 组合分类树
export function getCompositionNetWorthByMonthWithWeight(data) {
  return request({
    url: '/invest/networth/getCompositionNetWorthByMonthWithWeight',
    method: 'post',
    data
  })
}





